using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class ContentBuff : GeneratedMessageLite<ContentBuff, ContentBuff.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<ContentBuff, ContentBuff.Builder>
		{
			private bool resultIsReadOnly;
			private ContentBuff result;
			protected override ContentBuff.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override ContentBuff MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override ContentBuff DefaultInstanceForType
			{
				get
				{
					return ContentBuff.DefaultInstance;
				}
			}
			public int StartPos
			{
				get
				{
					return this.result.StartPos;
				}
				set
				{
					this.SetStartPos(value);
				}
			}
			public int TotLen
			{
				get
				{
					return this.result.TotLen;
				}
				set
				{
					this.SetTotLen(value);
				}
			}
			public SKBuiltinBuffer_t Content
			{
				get
				{
					return this.result.Content;
				}
				set
				{
					this.SetContent(value);
				}
			}
			public Builder()
			{
				this.result = ContentBuff.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(ContentBuff cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private ContentBuff PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					ContentBuff other = this.result;
					this.result = new ContentBuff();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override ContentBuff.Builder Clear()
			{
				this.result = ContentBuff.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override ContentBuff.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new ContentBuff.Builder(this.result);
				}
				return new ContentBuff.Builder().MergeFrom(this.result);
			}
			public override ContentBuff BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override ContentBuff.Builder MergeFrom(IMessageLite other)
			{
				if (other is ContentBuff)
				{
					return this.MergeFrom((ContentBuff)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override ContentBuff.Builder MergeFrom(ContentBuff other)
			{
				return this;
			}
			public override ContentBuff.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override ContentBuff.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(ContentBuff._contentBuffFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = ContentBuff._contentBuffFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 8u)
					{
						if (num3 == 0u)
						{
							throw InvalidProtocolBufferException.InvalidTag();
						}
						if (num3 == 8u)
						{
							this.result.hasStartPos = input.ReadInt32(ref this.result.startPos_);
							continue;
						}
					}
					else
					{
						if (num3 == 16u)
						{
							this.result.hasTotLen = input.ReadInt32(ref this.result.totLen_);
							continue;
						}
						if (num3 == 26u)
						{
							SKBuiltinBuffer_t.Builder builder = SKBuiltinBuffer_t.CreateBuilder();
							if (this.result.hasContent)
							{
								builder.MergeFrom(this.Content);
							}
							input.ReadMessage(builder, extensionRegistry);
							this.Content = builder.BuildPartial();
							continue;
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public ContentBuff.Builder SetStartPos(int value)
			{
				this.PrepareBuilder();
				this.result.hasStartPos = true;
				this.result.startPos_ = value;
				return this;
			}
			public ContentBuff.Builder ClearStartPos()
			{
				this.PrepareBuilder();
				this.result.hasStartPos = false;
				this.result.startPos_ = 0;
				return this;
			}
			public ContentBuff.Builder SetTotLen(int value)
			{
				this.PrepareBuilder();
				this.result.hasTotLen = true;
				this.result.totLen_ = value;
				return this;
			}
			public ContentBuff.Builder ClearTotLen()
			{
				this.PrepareBuilder();
				this.result.hasTotLen = false;
				this.result.totLen_ = 0;
				return this;
			}
			public ContentBuff.Builder SetContent(SKBuiltinBuffer_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasContent = true;
				this.result.content_ = value;
				return this;
			}
			public ContentBuff.Builder SetContent(SKBuiltinBuffer_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasContent = true;
				this.result.content_ = builderForValue.Build();
				return this;
			}
			public ContentBuff.Builder MergeContent(SKBuiltinBuffer_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasContent && this.result.content_ != SKBuiltinBuffer_t.DefaultInstance)
				{
					this.result.content_ = SKBuiltinBuffer_t.CreateBuilder(this.result.content_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.content_ = value;
				}
				this.result.hasContent = true;
				return this;
			}
			public ContentBuff.Builder ClearContent()
			{
				this.PrepareBuilder();
				this.result.hasContent = false;
				this.result.content_ = null;
				return this;
			}
		}
		public const int StartPosFieldNumber = 1;
		public const int TotLenFieldNumber = 2;
		public const int ContentFieldNumber = 3;
		private static readonly ContentBuff defaultInstance;
		private static readonly string[] _contentBuffFieldNames;
		private static readonly uint[] _contentBuffFieldTags;
		private bool hasStartPos;
		private int startPos_;
		private bool hasTotLen;
		private int totLen_;
		private bool hasContent;
		private SKBuiltinBuffer_t content_;
		private int memoizedSerializedSize = -1;
		public static ContentBuff DefaultInstance
		{
			get
			{
				return ContentBuff.defaultInstance;
			}
		}
		public override ContentBuff DefaultInstanceForType
		{
			get
			{
				return ContentBuff.DefaultInstance;
			}
		}
		protected override ContentBuff ThisMessage
		{
			get
			{
				return this;
			}
		}
		public int StartPos
		{
			get
			{
				return this.startPos_;
			}
		}
		public int TotLen
		{
			get
			{
				return this.totLen_;
			}
		}
		public SKBuiltinBuffer_t Content
		{
			get
			{
				return this.content_ ?? SKBuiltinBuffer_t.DefaultInstance;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasStartPos && this.hasTotLen && this.hasContent && this.Content.IsInitialized;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasStartPos)
				{
					num += CodedOutputStream.ComputeInt32Size(1, this.StartPos);
				}
				if (this.hasTotLen)
				{
					num += CodedOutputStream.ComputeInt32Size(2, this.TotLen);
				}
				if (this.hasContent)
				{
					num += CodedOutputStream.ComputeMessageSize(3, this.Content);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private ContentBuff()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] contentBuffFieldNames = ContentBuff._contentBuffFieldNames;
			if (this.hasStartPos)
			{
				output.WriteInt32(1, contentBuffFieldNames[1], this.StartPos);
			}
			if (this.hasTotLen)
			{
				output.WriteInt32(2, contentBuffFieldNames[2], this.TotLen);
			}
			if (this.hasContent)
			{
				output.WriteMessage(3, contentBuffFieldNames[0], this.Content);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasStartPos)
			{
				num ^= this.startPos_.GetHashCode();
			}
			if (this.hasTotLen)
			{
				num ^= this.totLen_.GetHashCode();
			}
			if (this.hasContent)
			{
				num ^= this.content_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object value)
		{
			ContentBuff contentBuff = value as ContentBuff;
			return contentBuff != null && (this.hasStartPos == contentBuff.hasStartPos && (!this.hasStartPos || this.startPos_.Equals(contentBuff.startPos_))) && (this.hasTotLen == contentBuff.hasTotLen && (!this.hasTotLen || this.totLen_.Equals(contentBuff.totLen_))) && (this.hasContent == contentBuff.hasContent && (!this.hasContent || this.content_.Equals(contentBuff.content_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<ContentBuff, ContentBuff.Builder>.PrintField("StartPos", this.hasStartPos, this.startPos_, writer);
			GeneratedMessageLite<ContentBuff, ContentBuff.Builder>.PrintField("TotLen", this.hasTotLen, this.totLen_, writer);
			GeneratedMessageLite<ContentBuff, ContentBuff.Builder>.PrintField("Content", this.hasContent, this.content_, writer);
		}
		public static ContentBuff ParseFrom(byte[] data)
		{
			return ContentBuff.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private ContentBuff MakeReadOnly()
		{
			return this;
		}
		public static ContentBuff.Builder CreateBuilder()
		{
			return new ContentBuff.Builder();
		}
		public override ContentBuff.Builder ToBuilder()
		{
			return ContentBuff.CreateBuilder(this);
		}
		public override ContentBuff.Builder CreateBuilderForType()
		{
			return new ContentBuff.Builder();
		}
		public static ContentBuff.Builder CreateBuilder(ContentBuff prototype)
		{
			return new ContentBuff.Builder(prototype);
		}
		static ContentBuff()
		{
			ContentBuff.defaultInstance = new ContentBuff().MakeReadOnly();
			ContentBuff._contentBuffFieldNames = new string[]
			{
				"Content",
				"StartPos",
				"TotLen"
			};
			ContentBuff._contentBuffFieldTags = new uint[]
			{
				26u,
				8u,
				16u
			};
			object.ReferenceEquals(micromsg.Proto.ContentBuff.Descriptor, null);
		}
	}
}
